﻿using System;
using System.Threading;

namespace Program14
{
    internal class Program
    {
        static void Main(string[] args)
        {
            //先暂停执行5秒
            //Thread.Sleep(3000);
            //Console.WriteLine("你好");

            Program thread1 = new Program();
            thread1.Method();

            //创建另一个线程来执行
            ThreadStart ts = new ThreadStart(thread1.Method);           
            Thread t = new Thread(ts);
            t.Start();
        }

        public void Method()
        {
            int i = 1;
            int j = 2;
            int result = i + j;
            Console.WriteLine("线程：{0},计算结果{1}", AppDomain.GetCurrentThreadId().ToString(), result);
        }
    }
}
